﻿@inherits PageBase

<Space Class="@ClassMapper.Class">
    <SpaceItem>
        <Dropdown Style="display: inherit; width: inherit;" OverlayClassName="container">
            <Overlay>
                <Menu Class="menu" OnMenuItemClicked="OnClickCallbackAsync">
                    <MenuItem Key="user"><Icon Type="user" Theme="outline" />用户中心</MenuItem>
                    <li Class="ant-dropdown-menu-item-divider"></li>
                    <MenuItem Key="logout"><Icon Type="logout" Theme="outline" />退出登录</MenuItem>
                </Menu>
            </Overlay>
            <ChildContent>
                <span class="action account">
                    <AuthorizeView>
                        <Authorized>
                            <Avatar Size="small"
                                    Class="avatar"
                                    Src="@context.User.Claims?.FirstOrDefault(x => x.Type == "avatar").Value"     
                                    Alt="avatar" />
                            <span class="name anticon">@context.User.Identity.Name</span>
                        </Authorized>
                    </AuthorizeView>
                </span>
            </ChildContent>
        </Dropdown>
    </SpaceItem>
</Space>